<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>积分订单</title>
    <script src="js/flexible.js"></script>
    <link rel="stylesheet" href="css/flexible.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/vant.css">
    <script src="js/vue/vue.js"></script>
    <script src="js/vue/axios.js"></script>
    <script src="js/vue/MD5.js"></script>
    <script src="js/vue/vant.js"></script>
</head>
<body class="jfdh_back">
<div id="app">
    <div class="jf_confirm" style="margin-bottom: .15rem;" v-for="item in dateList">
        <div class="jfdh_confirm_img">
            <img :src="item.Pic" onerror="this.src='images/zwt1.png'"/>
        </div>
        <div class="jfdh_confirm_m">
            <p>{{item.GoodsName}}</p>
            <p>x 1</p>
            <p>{{item.Addtime}}</p>
        </div>
        <div class="jfdh_confirm_m1">
            <p style="color:#E02020;">{{item.ConsumptionIntegral}}分</p>
            <p style="color:#000000;margin-top: .18rem;font-size: .14rem;">兑换成功</p>
        </div>
    </div>
    <van-list
        v-model="loading"
        :finished="finished"
        finished-text="没有数据了"
        @load="onload"
    >
    <van-cell
        v-for="item in lists"
        :key="item"
        :title="item"
    /> 
    </van-list> 
</div>
</body>
<script>
var app = new Vue({
    el: '#app',
    data: {
        dateList:[],
        from:{
            page:'1',
        },
        Count:'',
        listd:[],
        loading: false,
        finished: false,
        lists:[],
    },
    methods: {
       onload(){
        setTimeout(() => {
            // 异步更新数据
            getVs()
            const params=this.from
            axios.get('/mobileapi/member/user_info.php?act=integral_order',{params:params}).then(data =>{
                    let { msg, code,user} = data.data
                        if (code !== 200) {
                            window.vant.Toast.fail("加载失败")
                        } else {
                            data=data.data
                            // this.Count=data.data.Count
                            this.listd=data.data.list
                            if(this.listd.length>0){
                                this.totalnum=data.data.totalnum
                                this.from.page=parseInt(data.data.page)+1
                                for (let i = 0; i < this.listd.length; i++) {
                                    this.dateList.push(this.listd[i])
                                }
                                // 加载状态结束
                                this.loading = false
                                if (this.dateList.length >= this.totalnum) {
                                    this.loading = false
                                    this.finished = true
                                }
                            }else{
                                this.loading = false
                                this.finished = true
                            }
                        }
                    }).catch(function (error) {
                        console.log(error); 
                })
            }, 500)
       }
    }  
})    
</script>
</html>